package com.franklin.ideaplugin.easytesting.ui.execute;

import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiParameter;
import org.jetbrains.annotations.NotNull;

/**
 * 参数表单提供者
 *
 * @author Ye Junhui
 * @since 2023/7/2 11:27
 */
interface IParameterFormProvider {

    static IParameterFormProvider getInstance(Project project){
        return ServiceManager.getService(project,IParameterFormProvider.class);
    }

    /**
     * 是否是目标
     * @param defaultValue
     * @return
     */
    boolean isTarget(@NotNull Object defaultValue);

    /**
     * 构建表单
     * @param psiParameter
     * @param defaultValueOfPsiType
     * @param defaultValue
     * @return
     */
    ParameterTextComponent getForm(PsiParameter psiParameter, Object defaultValueOfPsiType, Object defaultValue);
}
